import request from '@/utils/request'

export default {
  // 列表
  query(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/list`,
      method: 'post',
      data
    })
  },
  // 详情
  detail(params) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/detail`,
      method: 'get',
      params
    })
  },
  // 设置货主比例
  percent(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/owner-percent`,
      method: 'post',
      data
    })
  },
  // 取消订单
  cancel(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/cancel`,
      method: 'post',
      data
    })
  },
  // 数据统计
  total(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/total`,
      method: 'post',
      data
    })
  },
  // 手工完结
  complete(params) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/complete`,
      method: 'get',
      params
    })
  },
  // 变更
  change(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/change`,
      method: 'post',
      data
    })
  },
  // 生成发货计划
  plan(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/deliver-plan`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // 调整采购单
  applyAdjust(data) {
    return request({
      url: `/v1/purchase/purchase-adjust/apply-adjust`,
      method: 'post',
      data
    })
  },
  // 获取海外仓备库订单数据
  getOversea(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/get-oversea`,
      method: 'post',
      data
    })
  },
  // 获取是否存在变更数据
  getChange(params) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/get-change`,
      method: 'get',
      params
    })
  },
  // 生成发货计划
  singlePlan(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/deliver`,
      method: 'post',
      data,
      returnData: true
    })
  },
  //完结
  batch_complete(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/batch-complete`,
      method: 'post',
      data,
      returnData: true
    })
  },
  //批量修改
  batch_edit(data) {
    return request({
      url: `/v1/purchase-demand/purchase-demand-sku/batch-edit`,
      method: 'post',
      data,
      returnData: true
    })
  },
}
